<%@ page language="java" contentType="text/html; charset=BIG5"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.util.*"%>
<%@ page import="com.likelist.model.*"%>
<%@ page import="com.member.model.*"%>
<%@ page import="com.goods.model.*"%>
<%@ page import="com.goodsClass.model.*"%>
<%@ page import="com.goodsColorClass.model.*"%>
<%@ page import="com.orderdetail.model.*"%>

<jsp:useBean id="goodSrv" scope="page"
	class="com.goods.model.GoodsService" />
<jsp:useBean id="goodClassSrv" scope="page"
	class="com.goodsClass.model.GoodsClassService" />
<jsp:useBean id="goodColorSrv" scope="page"
	class="com.goodsColorClass.model.GoodsColorClassService" />

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/front/order/style/noStock.css" />
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<title>Insert title here</title>
</head>
<body>
	<h4>非常抱歉,您下列選購的商品目前庫存不足</h4>
	<table id="detail_table">
		<tr>
			<th class="detailcol">商品照片</th>
			<th class="detailcol">顏色</th>
			<th class="detailcol">商品名稱</th>
			<th class="detailcol">尺寸</th>
			<th class="detailcol">商品單價</th>
			<th class="detailcol">數量</th>
			<th class="detailcol">小計</th>
		</tr>
		<%
			List<Order_detailVO> cart = (List<Order_detailVO>) session
					.getAttribute("cart");
			List<Integer> noStockList = (List<Integer>) request
					.getAttribute("noStockList");
			for (int j = 0; j < noStockList.size(); j++) {
				for (int i = 0; i < cart.size(); i++) {
					if (noStockList.get(j) == cart.get(i).getGoodsno()) {
						GoodsVO goodsVO = goodSrv.getOneGoods(cart.get(i)
								.getGoodsno());
						GoodsColorClassVO gccVO = goodColorSrv
								.getOneColorClass(goodsVO
										.getGoodsColorClassNo());
						GoodsClassVO gncVO = goodClassSrv
								.getOneGoodsClass(gccVO.getGoodsClassNo());
		%>

		<tr>
			<td class="detail"><img
				src="<%=request.getContextPath()%>/ShowImg?picno=<%=goodsVO.getGoodsColorClassNo()%>" /></td>
			<td class="detail">
				<div>
					<div>
						<img
							src="<%=request.getContextPath()%>/ShowColor?color=<%=goodsVO.getGoodsColorClassNo()%>"
							id="colorImg" />
					</div>
					<div id="colorName">
						<%=gccVO.getGoodsColor()%>
					</div>
				</div>
			</td>
			<td class="detail"><%=gncVO.getGoodsName()%></td>
			<td class="detail"><%=goodsVO.getGoodsSize()%></td>
			<td class="detail">NT$ <%=cart.get(i).getPrice()%></td>
			<td class="detail"> <%=cart.get(i).getOrder_qt()%></td>
			<td class="detail">NT$ <%=cart.get(i).getPrice()
								* cart.get(i).getOrder_qt()%></td>
		</tr>
		<%
			}
				}
			}
		%>
	</table>
</body>
</html>